<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
	<head>
		<title>Text Area Properties</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta content="noindex, nofollow" name="robots">
		<link href="../css/fck_control.css" type="text/css" rel="stylesheet"/>
		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
		<script type="text/javascript">
var dialog	= window.parent ;
var oEditor = dialog.InnerDialogLoaded() ;
var oDOM = oEditor.FCK.EditorDocument ;
var oActiveEl = dialog.Selection.GetSelectedElement() ;
var exist=false;
window.onload = function()
{
	oEditor.FCKLanguageManager.TranslatePage(document) ;
	if ( oActiveEl && oActiveEl.tagName == 'TEXTAREA' )
	{
		GetE('txtName').value		= oActiveEl.name ;
		GetE('txtId').value	= oActiveEl.id ;
		GetE('txtCols').value		= GetAttribute( oActiveEl, 'cols' ) ;
		var fontsize=oActiveEl.style.fontSize;
		GetE('txtSize').value	= parseInt((fontsize==""?10:fontsize));
		var rows = GetAttribute( oActiveEl, 'rows' );
		GetE('txtRows').value		= rows?rows:2 ;
		GetE('txtValue').value		= oActiveEl.value;
		GetE('underline').checked=GetAttribute(oActiveEl,'underline')==1 ;
	}
	else{
		if(oActiveEl){
			exist=true;
		}
		oActiveEl = null ;
	}
	dialog.SetOkButton( true ) ;
	dialog.SetAutoSize( true ) ;
	SelectField( 'txtName' ) ;
}

function Ok()
{
	if (GetE('txtName').value.Trim()=="")
	{
		alert(oEditor.FCKLang.Milan_NameEmpty);
		GetE('txtName').focus() ;
		return false ;
	}
	if(realLengthOverflow(GetE('txtName').value)){
		alert("名称不能超过30个字符！");
		GetE('txtName').focus() ;
		return false ;
	}
	if(fieldNameRegExp.test(GetE('txtName').value.Trim())){
		alert("名称不能带特殊字符！");
		GetE('txtName').focus() ;
		return false ;
	}
	if((!oActiveEl||oActiveEl.name!=txtName.value)&&!vilidateWidgetName(oEditor.FCK.EditorDocument,GetE('txtName').value)){
		alert("名称“"+GetE('txtName').value+"”已存在，请重新命名！");
		return false;
	}
	if ( isNaN( GetE('txtSize').value ) || GetE('txtSize').value < 0 )
	{
		alert("字体大小必须为大于0的数字！");
		GetE('txtSize').focus() ;
		return false ;
	}
	if( isNaN( GetE('txtCols').value ) || GetE('txtCols').value < 0 )
	{
		alert("宽度必须为大于0的数字！");
		GetE('txtCols').focus() ;
		return false ;
	}
	if( isNaN( GetE('txtRows').value ) || GetE('txtRows').value < 0 )
	{
		alert("行数必须为大于0的数字！");
		GetE('txtRows').focus() ;
		return false ;
	}
	oEditor.FCKUndo.SaveUndoStep() ;
	createElementIfNoExist(exist,"TEXTAREA",oActiveEl,oEditor);
	oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'TEXTAREA', 
			{name: GetE('txtName').value} ) ;
	oActiveEl.value=GetE('txtValue').value;
	oActiveEl.innerHTML=GetE('txtValue').value;
	oActiveEl.style.width='auto';
	oActiveEl.style.height="auto";
	var fontsize=GetE("txtSize").value;
	oActiveEl.style.fontSize=(fontsize==""?10:fontsize)+'pt';
	oActiveEl.style.lineHeight =(fontsize==""?10:fontsize)+'pt';
	SetAttribute( oActiveEl, 'cols', GetE('txtCols').value ) ;
	SetAttribute( oActiveEl, 'rows', GetE('txtRows').value ) ;
	SetAttribute( oActiveEl, 'id', GetE('txtId').value ) ;
	SetAttribute( oActiveEl, 'underline', GetE('underline').checked?1:0 ) ;
	return true ;
}

		</script>
	</head>
	<body style='OVERFLOW:hidden;margin:0;padding:0;' scroll='no'>
		<table class="control">
			<tr>
			    <th>*<span fckLang="DlgTextareaName">Name</span>：</th>
			    <td><input type="text" id="txtName" size="20">
			    <span style="display:block;color:#333;margin-top:5px;" fcklang="DlgNameRemind">输入提示</span>
			    	<div style="display:none;">
			        	<span fcklang="DlgUniqueId">Unique Identifier</span><br>
						<input id="txtId" type="text" size="20" maxlength="20"/>
					</div>
			    </td>
			</tr>
			<tr>
				<th><span fcklang="DlgTextValue">Value</span>：</th>
				<td><input id="txtValue" type="text" size="25" /></td>
			</tr>
			<tr>
				<th><span fcklang="DlgTextCharWidth">Character Size</span>：</th>
				<td><input id="txtSize" type="text" size="5" value="10"/>&nbsp;pt</td>
			</tr>
			<tr>
			    <th><span fckLang="DlgTextareaCols">Width</span>：</th>
				<td><input id="txtCols" type="text" size="5" value="10"></td>
			</tr>
			<tr>
			    <th><span fckLang="DlgTextareaRows">Rows</span>：</th>
				<td><input id="txtRows" type="text" size="5" value='2'></td>
			</tr>
			<tr>
				<th><span fcklang="DlgSelectUnderline">Underline</span>：</th>
				<td><input id="underline" type="checkbox">
				<span style="color:#333;margin-top:5px;" fcklang="DlgUnlineRemind">输入提示</span></td>
			</tr>
		</table>
	</body>
</html>
